package rectangle;

import java.util.Scanner;

public class TestRectangle {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入矩形的长：");
        double length = scanner.nextDouble();
        System.out.println("请输入矩形的宽：");
        double width = scanner.nextDouble();

        // 创建矩形对象
        Rectangle rectangle = new Rectangle(length, width);

        // 计算并输出周长和面积
        System.out.println("矩形的周长是：" + rectangle.getPerimeter());
        System.out.println("矩形的面积是：" + rectangle.getArea());

        scanner.close();
    }
}
